package com.five.monkey.feign.consumer.client.fallback;

import com.five.monkey.feign.consumer.client.TestFeignClient;
import com.five.monkey.vo.CommonVo;
import com.five.monkey.vo.TestVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @author 狻猊
 * @date 2021/8/9 下午3:34
 */
@Component
public class TestFeignClientFallback implements TestFeignClient {

    private static Logger logger = LoggerFactory.getLogger(TestFeignClientFallback.class);

    public CommonVo<TestVo> testGet(String name, int age, float score) {
        logger.error("/provider/test/get请求异常。name={},age={},score={}", name, age, score);
        return CommonVo.exception(1, "/provider/test/get请求异常");
    }

    public CommonVo<TestVo> testPost(TestVo testVo) {
        logger.error("/provider/test/post请求异常。name={},age={},score={}", testVo.getName(), testVo.getAge(), testVo.getScore());
        return CommonVo.exception(1, "/provider/test/post请求异常");
    }
}
